﻿@using EasyCourse.DB;
@using EasyCourse.Model;
@{
    CommonPageInfo pageInfo = ViewData[CommonViewDataKey.CommonPageInfo] as CommonPageInfo;
    //最新讨论
    IList<DiscussionInfo> discussionInfo = DiscussionInfoManage.Instance.GetNewstListBy(pageInfo.CourseId);

    var newestList = AnnounceInfoManage.Instance.GetNewestList(pageInfo.CourseId, 5);
    var courseInfoList = CourseInfoManage.Instance.GetAll();
}
<div class="rBox publicRBox part mb15">
    <div class="rBox-th">
        <h3 class="fl">最新通知</h3>
        <a href="@Url.Action("AnnounceInfoBrowse", "Announce")?CourseId=@pageInfo.CourseId" target="_blank" class="fr orange">更多&gt;&gt;</a>
    </div>
    <div class="rBox-tb">
        <ul class="ulTxtList">
            @foreach (var item in newestList)
            {
                <li><a target="_blank" href="@Url.Action("AnnounceInfoDetail","Announce")?Id=@item.Id&CourseId=@pageInfo.CourseId"><span class="sTime">@item.CreateTime.ToTimeString()</span>[@(CourseInfoManage.Instance.GetCourseNameById(courseInfoList, item.CourseId))] @item.Title</a></li>
            }
        </ul>
    </div>
</div>
<div class="rBox publicRBox part">
    <div class="rBox-th">
        <h3 class="fl">最新讨论</h3>
        <a href="@Url.Action("List","Discussion")?CourseId=@pageInfo.CourseId" target="_blank" class="fr orange">更多&gt;&gt;</a>
    </div>
    <div class="rBox-tb">
        <ul class="ulTxtList">
            @foreach (var item in discussionInfo)
            {
                <li><a href="@Url.Action("Detail", "Discussion")?CourseId=@item.CourseId&DiscussId=@item.Id" target="_blank"><span class="sTime">@item.CreateTime.ToTimeString()</span>[@(CourseInfoManage.Instance.GetCourseNameById(courseInfoList, item.CourseId))]@item.Title</a></li>
            }
        </ul>
    </div>
</div>